package com.deodar.system.service.impl;

import com.deodar.common.annotation.DataSource;
import com.deodar.common.enums.DataSourceType;
import com.deodar.system.domain.SubscribedInfo;
import com.deodar.system.mapper.SubscribedInfoMapper;
import com.deodar.system.service.ISubscribedInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@DataSource(value = DataSourceType.SLAVE)
@Service("subscribedInfoService")
public class SubscribedInfoServiceImpl implements ISubscribedInfoService {

    @Resource
    private SubscribedInfoMapper subscribedInfoMapper;
    @Override
    public List<SubscribedInfo> findByPripid(String pripid) {
        List<SubscribedInfo> infos = subscribedInfoMapper.selectByPripid(pripid);
        for (SubscribedInfo info : infos){
            info.setCurrency("156");
        }
        return infos;
    }

    @Override
    public List<SubscribedInfo> findList(int startNd, int endNd) {
        List<SubscribedInfo> infos = subscribedInfoMapper.selectList(startNd, endNd);
        for (SubscribedInfo info : infos){
            info.setCurrency("156");
        }
        return infos;
    }
}
